<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>原型对象创建方法案例</title>
    <script>
        function Clothes(clothes, color) {
            this.clothes = clothes
            this.color = color
        }

        Clothes.prototype.type = '衣服'
        Clothes.prototype.Clothes_fun = function() {
            document.write('小美穿的' + clothes2.type + '是' + clothes2.color + '的' + clothes2.clothes)
        }

        var clothes1 = new Clothes('连衣裙', '黑色')
        var clothes2 = new Clothes('吊带裙', '黄色')

        document.write(clothes1.color + '的' + clothes1.clothes + '是小丽穿的' + clothes1.type + '<br/>')
        document.write(clothes2.color + '的' + clothes2.clothes + '是小美穿的' + clothes2.type + '<br/>')
        clothes2.Clothes_fun()
    </script>
</head>

<body>

</body>

</html>